package com.yc.script;

import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;

public class InvokePython {
	
	public void m1() throws IOException, InterruptedException {
		String exe = "python";
        String command = "F:\\workspace-py\\test\\test1.py";
        String num1 = "1";
        String num2 = "2";
        String[] cmdArr = new String[] {exe, command};
        Process process = Runtime.getRuntime().exec(cmdArr);
        InputStream is = process.getInputStream();
        DataInputStream dis = new DataInputStream(is);
        String str = dis.readLine();
        process.waitFor();
        System.out.println(str);
	}

	public static void main(String[] args) {
		InvokePython ip = new InvokePython();
		try {
			ip.m1();
		} catch (IOException | InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}
	
	

}
